let Main=require('yg-Main');

cc.Class({
    extends: cc.Component,

    properties: {
    },

    onLoad(){
        Main.UI=this;
    },
    start () {
        //实例化一堆常用的组件放着

    },
    showLoadding(obj={txt:'加载中。。。'}){
        cc.resources.load('UI/Loadding', cc.Prefab, (err, prefab) => {
            this._loadding=cc.instantiate(prefab);
            this.node.addChild(this._loadding);
            this._loadding.getComponent(require('UI.Loadding')).txt=obj.txt;
        });
    },
    hideLoadding(){
        if(this._loadding){
            this._loadding.destroy();
            this._loadding=null;
        }
    }
});
